/** 
 Project Suffix Trees for Natural Language (STNL) (C) 2006 Fabian Steeg

 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */
package traj.algo;

import java.util.ArrayList;
import java.util.List;

import junit.framework.TestCase;
import traj.algo.suffixtrees.NumericSuffixTree;
import traj.algo.suffixtrees.SimpleSequenceAccessor;
import traj.algo.suffixtrees.node.memory.SimpleNodeAccessor;

/**
 * Test for {@link NumericSuffixTree}
 * 
 * @author Fabian Steeg (fsteeg)
 */
public class TestUkkonenSuffixTree extends TestCase {

	/**
	 * Test method for'de.uni_koeln.spinfo.strings.plugin.algo.suffixtrees.UkkonenSuffixTree.printTree(int)
	 * '
	 */
	public void testPrintTree() {
//		// single list
//		ArrayList<Long> single_l = new ArrayList<Long>();
//		ArrayList<Long> single_ll = new ArrayList<Long>();
//		ArrayList<List<Long>> containerList = new ArrayList<List<Long>>();
//		
//		ArrayList<Long> ll1 = new ArrayList<Long>();
//		
//		single_l.add(3l);
//		single_l.add(1l);
//		single_l.add(2l);
//		
//		single_ll.add(4l);
//		single_ll.add(1l);
//		single_ll.add(2l);
//		
//		containerList.add(single_l);
//		containerList.add(single_ll);
//		
//		ll1.add(3l);
//		ll1.add(1l);
//		ll1.add(2l);
//		ll1.add(4l);
//		ll1.add(1l);
//		ll1.add(2l);
//		
//		
//		//The folowing two trees should be the same
//		NumericSuffixTree tree1 = new NumericSuffixTree(
//				new SimpleNodeAccessor(), new SimpleSequenceAccessor());
//		NumericSuffixTree tree2 = new NumericSuffixTree(
//				new SimpleNodeAccessor(), new SimpleSequenceAccessor());
//		tree1.addSequences(containerList, 1);
//		tree1.exportDot("c:\\temp\\simple-tree3.dot");
//		
//		tree2.addSequences(ll1, 1, false);
//		tree2.exportDot("c:\\temp\\simple-tree4.dot");
//		
		//==============================================================		
		NumericSuffixTree tree = new NumericSuffixTree(
				new SimpleNodeAccessor(), new SimpleSequenceAccessor());

		ArrayList<Long> l1 = new ArrayList<Long>();
		l1.add(1l);
		l1.add(2l);
		l1.add(3l);
		l1.add(1l);
		l1.add(2l);
		l1.add(4l);
		
		ArrayList<Long> l2 = new ArrayList<Long>();
		l2.add(1l);
		l2.add(2l);
		l2.add(3l);
		l2.add(4l);
		l2.add(6l);
		l2.add(5l);
		tree.addSequences(l1, 3, false);
		tree.addSequences(l2, 9, false);
		tree.exportDot("c:\\temp\\together.dot");
	}

}
